/*
 *  SSCommentView.h
 *  MESLib
 * 
 * Copyright 2003-2009 Starline Software Ltd
 * 
 * This file is part of MESLib.
 * 
 * MESLib is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * MESLib is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with MESLib. If not, see <http://www.gnu.org/licenses/>.
 */
//  Created by Tobias Haughton on Thu Feb 06 2003.
//

#import <AppKit/AppKit.h>
#import "SSConst.h"

@class SSCatalystComment;

@interface SSCommentView : NSView {
   NSTextField *commentField;
   SSCatalystComment *owner;
   NSPoint distanceFromOrigin;
   NSImage *commentImage;
   NSPoint imagePoint;
   NSRect fromRect;
   NSBezierPath *borderPath;
   NSMenu *commentMenu;
   NSTextStorage *textStorage;
   NSRect testCellBounds;
   BOOL isSelected;
}

- (id)initWithFrame:(NSRect)frame
             string:(NSString *)commentString
               type:(NSNumber *)type
              owner:(SSCatalystComment *)own;
- (id)initWithCommentView:(SSCommentView *)view;

- (void)setTypeFromMenu:(NSMenuItem *)item;

- (SSCatalystComment *)owner;
- (void)setOwner:(SSCatalystComment *)own;

- (void)allowEditingInFieldIfUnderPoint:(NSPoint)point;
- (void)selectFieldForEditing;


- (void)setCommentImage;

- (void)updateCommentString;

- (void)createMenu;

- (void)setPaths;

- (void)resizeSelfAndField;

- (BOOL)isSelected;
- (void)setSelected;
- (void)setUnselected;

- (void)setDistanceFromOrigin:(NSPoint)point;
- (void)setNewOriginWithPoint:(NSPoint)point;

- (BOOL)isFullyWithinRect:(NSRect)rect;


@end
